import { array } from 'vue-types'

import type { ICreateUserReq } from '@/apis'

import type UserDialog from './UserDialog'

export const userDialogProps = () => ({
  deptTreeData: array().def([]),
  sexOptions: array<OptionItem>().def([]),
  statusOptions: array<OptionItem>().def([])
})

export const formData = (): ICreateUserReq => ({
  nickName: '',
  deptId: '',
  phone: '',
  email: '',
  userName: '',
  password: '123456',
  sex: '0',
  status: '0',
  postIds: [],
  roleIds: [],
  remark: ''
})

export type IFormData = ICreateUserReq
export type UserDialogRef = InstanceType<typeof UserDialog>
